{% from 'common/_macro.html' import static %}
<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    {% include 'common/_heads.html' %}
    <link rel="stylesheet" href="{{ static('front/css/front_base.css') }}">
    <title>{% block title %}{% endblock %}</title>
{% block head %}

{% endblock %}
</head>
<body>
<div id="goTop" class="goTop"></div>
<script type="text/javascript">
    $(window).scroll(function(){
        var sc=$(window).scrollTop();
        var height = $(window).height();
        var rwidth=$(window).width()+$(document).scrollLeft();
        var rheight=$(window).height()+$(document).scrollTop();
        if(sc>0){
            $("#goTop").css("display","block");
            $("#goTop").css("left",(rwidth-80)+"px");
            $("#goTop").css("top",(rheight-120)+"px");
        }else{
            $("#goTop").css("display","none");
        }
    });
    $("#goTop").click(function(){
        $('body,html').animate({scrollTop:0},300);
    });
</script>

<nav class="navbar navbar-inverse nav-info">
  <div class="container-fluid">
    <div class="navbar-header">
      <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#bs-example-navbar-collapse-1" aria-expanded="false">
        <span class="sr-only">Toggle navigation</span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
        <span class="icon-bar"></span>
      </button>
      <a class="navbar-brand" href="/">
          <img src="{{ url_for('static',filename='imgs/front/12.png') }}" alt="">
      </a>
    </div>
    <div class="collapse navbar-collapse" id="bs-example-navbar-collapse-1">
      <ul class="nav navbar-nav" >
{#        <li class="active"><a  href="/">首页<span class="sr-only">(current)</span></a></li>#}
      </ul>
      <form class="navbar-form navbar-left" action="{{ url_for("front.search") }}">
        <div class="form-group search-input"  >
          <input name="q" type="text" class="form-control" placeholder="Search">
        </div>
        <button  type="submit" class="btn btn-img" style="background: transparent">
            <img src="{{ static('imgs/front/s1.png') }}" alt="">
        </button>
      </form>
      <ul class="nav navbar-nav navbar-right navbar-user-info">
        {% if g.front_user %}
            <a href="{{ url_for('front.profile',user_id = g.front_user.id) }}"  class="user-avatar-group">
              <img src="{{ g.front_user.avatar or url_for('static',filename='imgs/front/logo3.png') }}" alt="">
          </a>
            <span id="login-tag" data-is-login="1" style="display: none"></span>
            <li class="dropdown">
                <a class="dropdown-toggle" style="cursor: pointer;font-family: 'Times New Roman', Times, serif;" type="button" id="dropdownMenu1" data-toggle="dropdown"
                        aria-haspopup="true" aria-expanded="true">
                    {{ g.front_user.username }}
                    <span class="caret"></span>
                </a>
                <ul class="dropdown-menu" aria-labelledby="dropdownMenu1">
                    <li><a href="{{ url_for('front.profile',user_id = g.front_user.id) }}">个人中心</a></li>
                    <li><a href="#">设置</a></li>
                    <li><a href="{{ url_for('front.logout') }}">注销</a></li>
                </ul>
            </li>
            {% else %}
            <li><a href="{{ url_for('front.signin') }}">登录</a></li>
            <li><a href="{{ url_for('front.signup') }}">注册</a></li>
        {% endif %}
      </ul>
    </div><!-- /.navbar-collapse -->
  </div><!-- /.container-fluid -->
</nav>
<div class="container">
    {% block body %}{% endblock %}
</div>
<footer class="main-footer">
    <div class="container">
        <div class="widget">
            <a class="showWx">
                <span class="wx">DX.Ssssss</span>
            </a>
            <p class="bottom-info" >
                <span>DXS.Ssssss</span>
                <span>2018.1.15</span>
                <span>天道酬勤，栋梁之才</span>
            </p>
        </div>
    </div>
</footer>
</body>
</html>